# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(bluetooth_mesh_net)

FILE(GLOB app_sources src/*.c)
target_sources(app
  PRIVATE
  ${app_sources}
  ${ZEPHYR_BASE}/subsys/bluetooth/mesh/net.c
)

target_include_directories(app
  PRIVATE
  ${ZEPHYR_BASE}/subsys/bluetooth/mesh
  ${ZEPHYR_BASE}/subsys/bluetooth
  ${ZEPHYR_MBEDTLS_MODULE_DIR}/include
)

target_compile_options(app
  PRIVATE
  -DCONFIG_BT_MESH_NET_STORE_TIMEOUT=1
  -DCONFIG_BT_SETTINGS
  -DCONFIG_PSA_CRYPTO_PROVIDER_MBEDTLS
  -DCONFIG_BT_MESH_MSG_CACHE_SIZE=32
  -DCONFIG_BT_MESH_LOOPBACK_BUFS=3
  -DCONFIG_BT_MESH_SEQ_STORE_RATE=128
  -DCONFIG_BT_MESH_IVU_DIVIDER=4
  -DCONFIG_BT_MESH_IV_UPDATE_SEQ_LIMIT=0x800000
  -DCONFIG_BT_MESH_SAR_TX_SEG_INT_STEP=0x05
  -DCONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_COUNT=0x02
  -DCONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_WITHOUT_PROG_COUNT=0x02
  -DCONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_STEP=0x07
  -DCONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_INC=0x01
  -DCONFIG_BT_MESH_SAR_TX_MULTICAST_RETRANS_COUNT=0x02
  -DCONFIG_BT_MESH_SAR_TX_MULTICAST_RETRANS_INT=0x09
  -DCONFIG_BT_MESH_SAR_RX_SEG_THRESHOLD=0x03
  -DCONFIG_BT_MESH_SAR_RX_ACK_DELAY_INC=0x01
  -DCONFIG_BT_MESH_SAR_RX_DISCARD_TIMEOUT=0x01
  -DCONFIG_BT_MESH_SAR_RX_SEG_INT_STEP=0x05
  -DCONFIG_BT_MESH_SAR_RX_ACK_RETRANS_COUNT=0x00
)
